<template>
	<view class="bigView">
		<!-- <z-paging ref="paging" v-model="dataList" @query="queryList"> -->
			<view slot="top" style="display: flex;justify-content: center;background-color: white;flex-direction: column;">
				<navBar slot="top" title="查询"></navBar>
				<!-- <u-tabs :list="list1" @click="click"></u-tabs> -->
				<!-- <view style="width: 100%;display: flex;justify-content: center;color:black;font-weight: bold">需要开放端口</view> -->
				<u-tabs style="font-size: 14px;" :activeStyle="{
					color: '#1875FF',
					fontWeight: 'bold',
					transform: 'scale(1.05)',
					fontSize:'14px'
				}" :inactiveStyle="{
					color: '#00000080',
					transform: 'scale(1)',
					fontSize:'14px'
				}" lineColor='#1875FF' :list="list1" @click="click"></u-tabs>
			</view>
			<view style="background-color: white;margin-top: 8px;overflow-y: auto;" v-if="tabIndex ==0">
				<!-- <u-cell size="large" title="出勤天数-标准" :value="itemInfo.stdAttendanceDays"></u-cell> -->
				<u-cell size="large" title="出勤天数-实际" :value="itemInfo.actualAttendanceDays"></u-cell>
				
				<!-- <u-cell size="large" title="出勤工时-标准" :value="itemInfo.stdAttendanceHours"></u-cell> -->
				<u-cell size="large" title="出勤工时-实际" :value="itemInfo.actualAttendanceHours	"></u-cell>
				<!-- <u-cell size="large" title="正班工时-标准" :value="itemInfo.stdNormalHours"></u-cell> -->
				<u-cell size="large" title="正班工时-实际" :value="itemInfo.actualNormalHours"></u-cell>
				<u-cell size="large" title="加班工时-平时" :value="itemInfo.wdovHours"></u-cell>
				<u-cell size="large" title="加班工时-休息" :value="itemInfo.wkovHours"></u-cell>
				<u-cell size="large" title="加班工时-法假" :value="itemInfo.lgovHours"></u-cell>
				<u-cell size="large" title="缺勤工时-迟到次数" :value="itemInfo.lateNum"></u-cell>
				<u-cell size="large" title="缺勤工时-早退次数" :value="itemInfo.earlyNum"></u-cell>
				<u-cell size="large" title="缺勤工时-缺勤" :value="itemInfo.absentHours"></u-cell>
				<u-cell size="large" title="请假时数-年假" :value="itemInfo.annualHours"></u-cell>
				<u-cell size="large" title="请假时数-事假" :value="itemInfo.personalHours"></u-cell>
				<u-cell size="large" title="请假时数-病假" :value="itemInfo.sickHours"></u-cell>
				<u-cell size="large" title="请假时数-产假" :value="itemInfo.maternityHours"></u-cell>
				<u-cell size="large" title="请假时数-丧假	" :value="itemInfo.bereavementHours"></u-cell>
				<u-cell size="large" title="请假时数-工伤假" :value="itemInfo.workInjuryHours"></u-cell>
				<u-cell size="large" title="请假时数-婚假" :value="itemInfo.marriageHours"></u-cell>
				<u-cell size="large" title="请假时数-难产假" :value="itemInfo.hardBirthHours"></u-cell>
				<u-cell size="large" title="请假时数-育儿假" :value="itemInfo.parentalHours"></u-cell>
				<u-cell size="large" title="请假时数-护理假" :value="itemInfo.nursingHours"></u-cell>
				<u-cell size="large" title="请假时数-加班请假" :value="itemInfo.overtimeHours"></u-cell>
			</view>
			<view style="background-color: white;margin-top: 8px;" v-else-if="tabIndex ==1">
				<u-cell size="large" title="享有年假(天)" :value="itemInfo.annualDays"></u-cell>
				<u-cell size="large" title="享有年假(时)" :value="itemInfo.annualHours"></u-cell>
				<u-cell size="large" title="年假区间" :value="itemInfo.annualPeriod"></u-cell>
				<u-cell size="large" title="剩余年假(时)" :value="itemInfo.remainHours"></u-cell>
				<u-cell size="large" title="已休年假(时)" :value="itemInfo.usedHours"></u-cell>
			</view>
			<!-- <view class="itemView" v-for="(item, index) in dataList" :key="index" v-if="tabIndex==0">
				<view class="itemTitle">
					<view style="color: #000000;font-size: 16px;font-weight: bold;">{{item.theme}}</view>
				</view>
				<view class="itemContent" v-html="item.content">
					
				</view>
			</view>
			<view class="itemView" v-else v-for="(item, index) in dataList" :key="index">
				<view class="itemTitle">
					<view style="color: #000000;font-size: 16px;font-weight: bold;">{{item.jobScope}}</view>
					<view style="color: #247BFD;font-size: 14px">{{item.newScope}}</view>
				</view>
				<view class="itemContent" v-html="item.content">
					
				</view>
			</view> -->
			<!-- <view style="width: 100vw;flex: 1;display: flex;justify-content: center;margin-top: 20px">
				<image src="https://l-cllyert.oss-accelerate.aliyuncs.com/video_file/时薪图片.JPG" @click="showImg()" v-if="tabIndex==0"></image>
				<image src="https://l-cllyert.oss-accelerate.aliyuncs.com/video_file/月薪图片.JPG" @click="showImg2()" v-else></image>
			</view> -->
		<!-- </z-paging> -->
	</view>
</template>

<script>
	// import recruitmentCharter from '@/api/recruitmentCharter.js'
	// import internalRecommendation from '@/api/internalRecommendation.js'
	import mine from '@/api/mine.js'
	import navBar from "@/components/nav_bar.vue"
	export default{
		components:{
			navBar
		},
		data(){
			return {
				bottom:0,
				dataList:[],
				tabIndex:0,
				recruitmentType:'',
				list1: [{
					name: '工时查询',
					value:'0'
				}, {
					name: '年假查询',
					value:'1'
				}],
				itemInfo:{}
			}
		},
		mounted() {
			uni.getSystemInfo({success: (e) => {
				// this.StatusBar = e.statusBarHeight;
				let custom = wx.getMenuButtonBoundingClientRect();
				this.bottom = custom.bottom;
				// this.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
				// this.TopHeight = this.CustomBar+100;//this.StatusBar+this.CustomBar;
			}})
			// this.listRequest()
			this.getUserHandle();
		},
		methods:{
			click(item) {
				this.tabIndex = item.index;
				// this.recruitmentType = item.value;
				// this.$refs.paging.reload()
				// if(this.tabIndex==0){
				// 	this.listRequest()
				// }else{
				// 	this.listRequest2(item.value)
				// }
				this.getUserHandle()
			},
			showImg(){
				uni.previewImage({
					indicator: "none",
					loop: false,
					urls: ['https://l-cllyert.oss-accelerate.aliyuncs.com/video_file/时薪图片.JPG'],
				})
			},
			showImg2(){
				uni.previewImage({
					indicator: "none",
					loop: false,
					urls: ['https://l-cllyert.oss-accelerate.aliyuncs.com/video_file/月薪图片.JPG'],
				})
			},
			getUserHandle(){
				if(this.tabIndex == 0){// 工时查询
					uni.setNavigationBarTitle({
						title:"工时查询"
					})
					mine.getWorkingHoursInfo({}).then(res =>{
						console.log(res.dataList)
						this.itemInfo = res.dataList[0];
						// uni.setStorageSync("userInfo",JSON.stringify(res))
					}).catch(err =>{
						
					})
				}else {// 年假查询
					uni.setNavigationBarTitle({
						title:"年假查询"
					})
					mine.getAnnualLeaveInfo({}).then(res =>{
						console.log(res.dataList)
						this.itemInfo = res.dataList[0];
						// uni.setStorageSync("userInfo",JSON.stringify(res))
					}).catch(err =>{
						
					})
				}
				
			},
			// queryList(pageNo, pageSize) {
			// 	if(this.tabIndex==0){
			// 		recruitmentCharter.listHandle({page:pageNo,size:pageSize}).then(res =>{
			// 			let records = res.records;
			// 			if(pageNo==1){
			// 				this.dataList = records;
			// 			}else{
			// 				this.dataList.concat(records)
			// 			}
			// 			this.$refs.paging.complete(res.records);
			// 		}).catch(error =>{
			// 			this.$refs.paging.complete(false);
			// 		})
			// 	}else{
			// 		internalRecommendation.listHandle({page:pageNo,size:pageSize,recruitmentType:this.recruitmentType}).then(res =>{
			// 			let records = res.records;
			// 			if(pageNo==1){
			// 				this.dataList = records;
			// 			}else{
			// 				this.dataList.concat(records)
			// 			}
			// 			this.$refs.paging.complete(records);
			// 		}).catch(error =>{
			// 			this.$refs.paging.complete(false);
			// 		})
			// 	}
				
			// },
			sureHandle(){
				uni.navigateBack()
			}
		},
		onReady() {
			
		}
	}
</script>

<style lang="scss" scoped>
.bigView{
	width: 100vw;
	height: 100vh;
	background-color: #F7F7F7;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}
.topView{
	flex-grow: 1;
	// width: 100vw;
	// background-color: green;
	display: flex;
	flex-direction: column;
	width: 100vw;
	overflow-y: auto;
}
.itemView{
	display: flex;
	flex-direction: column;
	width: calc(100vw - 32px);
	border-radius: 12px;
	margin-left: 16px;
	// padding: 12px;
	background-color: white;
	margin-top: 8px;
	.itemTitle{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 12px;
	}
	.itemContent{
		padding: 0 12px 12px 12px;
		font-size: 12px;
		color: #333333;
		// margin-top: 12px;
	}
}
</style>